<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

<head>
   <%@ include file="/common/CimsCommon.jsp" %>	
   <title>新增合作机构贷款交易流水表</title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="<%=basePath%>/css/cims/cmmBase.css">
	<script type="text/javascript" src="<%=basePath%>/js/cims/loanDealManage/loanDealDetail.js"></script>
	<script type="text/javascript" src="${basePath}/js/cims/publicJs/modelManage.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			var value = $('#dtocooperorgCode').val();
			var cooperorgType = $('#cooperorgType').val();
			$("#finishBtn").hide();//完成按钮隐藏
			if(value==""|| null ==value){
				toAddContract();
				$("#creditRestrainTitle").hide();
				$("#creditRestrainTitleValue").hide();
				$("#creditOperation").hide();
				$("#creditPackageColumn").hide();
				$("#creditDetailOperation").hide();
				$("#creditDetailTable").hide();
				$("#statementTr").hide();
			}else{
				$("#creditDetailTable").hide();
				$("#raisePlan").hide();
				
				searchCreditPackage("creditPackage");
				searchRaisePlan();
				if(cooperorgType!=cimsConstant.COOPERORG_TYPE_TWO){
					$("#downLoadFile").hide();
				}
			}
			costParameters("costParameterLoan");

		});
	</script>
	
</head>
<iframe id='downFrameId' src="" style="width:0;height:0;"></iframe>
<body style="background-color:#FFFFFF;">
<div id="formPageSwap">
  <br/>
<form id="addNewsFormData" name="addNewsFormData" isCheck="true" action="com.jy.modules.cims.creditDeal.controller.TCMmCooperorgDealController">
 <table id="addNewsTableId" class="formTableSwap" style="background:#D9D8DF;" border="0" align="center" cellpadding="0" cellspacing="1" >
<tr>
<td colspan="6" align="center" class="thTop">合约信息 <span id="spanCode"><a class="aColor" href="javascript:void(0)" onclick="toAddContract()" >导入合约</a></span></td>
</tr>
<tr>
  <th> 合作机构 ：</th>
  <td >
  <input type="text" style="display:none;" id="exportType" value="loan">
  <input type="text" style="display:none;" id="cooperorgType" value="${dto.cooperorgDTO.type}">
  <input type="text" style="display:none;" id="isPlan" value="${dto.cdto.isPlan}">
  <input type="text" style="display:none;" id="isDelete" value="false">
  <input type="text" style="display:none;" id="isDeleteAndIsExport" value="false">
  <input type="text" style="display:none;" name="id" id="idValue" >
  <input type="text" style="display:none;" name="dealCode" id="dealCode" >
    <input type="text" style="display:none;" name="dealDate" id="dealDate" value="">
  <input type="text" style="display:none;" name="fileName" id="fileName" value="贷款信息">
  <input type="text" style="display:none;" name="dealTypes" id="dealTypes" value="'04','03'">
  <input type="hidden"  name="defaultPlanId" id="defaultPlanId" value="-1">
  <input type="hidden"  name="isFinishEd" id="isFinishEd" value="false">
  <input disabled="disabled" style="display:none;" type="text" class="text" id="dtocooperorgCode" name="cooperorgCode"   value="${dto.cooperorgDTO.cooperorgCode}" />
  <input disabled="disabled" type="text" class="text" id="dtocooperorgName" name="cooperorgName"   value="${dto.cooperorgDTO.cooperorgName}" />
  </td>
  <th> 协议名称 ：</th>
  <td >
  <input disabled="disabled" style="display:none;" type="text" class="text" id="dtoagreementCode" name="agreementCode"   value="${dto.agreementDTO.agreementCode}" /> 
  <input disabled="disabled" type="text" class="text" id="dtoagreementName" name="agreementName"   value="${dto.agreementDTO.agreementName}" />
  </td>
  <th> 合约名称 ：</th>
  <td >
  <input disabled="disabled" style="display:none;" type="text" class="text" id="productType" name="productType"   value="${dto.cdto.productType}" />
  <input disabled="disabled" style="display:none;" type="text" class="text" id="dtocontractCode" name="contractCode"   value="${dto.cdto.contractCode}" />
  <input disabled="disabled" type="text" class="text" id="dtocontractName" name="contractName"   value="${dto.cdto.contractName}" />
  </td> 
</tr>

<tr>
<th style="display:none;"> 交易类型 ：</th>
  <td style="display:none;">
	<syscode:dictionary name="dealType" extendProperty="notNull=false" codeType="LOAN_DEAL_TYPE" id="dealType"	
      defaultValue="${dto.cdto.dealType}" className="text" type="select"/>
  </td>
  
  <!-- <th> 申请额度：</th>
   <td>
  	  <input type="text" class="text" id="dtoquotaSum" name="quotaSum"  maxLength="10" value="" >
  </td> -->
  <th> 价格认定方：</th>
  <td colspan="5"> 
<syscode:dictionary name="creditorAffirmRule" extendProperty="notNull=false" codeType="creditConfirm" id="creditorAffirmRule"	
      defaultValue="${dto.cdto.creditorAffirmRule}" className="text" type="select"/>
   </td>  
</tr>
<tr id="creditRestrainTitle">
<td colspan="6" align="center" class="thTop">债权约束</td>
</tr>

<tr id="creditRestrainTitleValue">
	<td colspan="6">
		<%@include file="../limitRequest/contractConstraint.jsp" %>
	</td>
</tr>

<tr id="creditOperation">
 	<td colspan="6" align="center" class="thTop">贷款操作</td>	
</tr>

<tr id="creditPackageColumn">
	<th> 包规则：</th>
   <td >
   		<select id="packageRule" >
   			<option value="01">包批次</option>
   			<!-- <option value="02">账单日</option> -->
   		</select>
  </td>
   <th> 选择包：</th>
   <td >
  	  <select id="creditPackage" onchange="creditPackageOperation(this)"></select>
<!--   	<input id="creditPackageWrite"  type="text">
 -->  </td>
 	<th><span id="raisePlanSpan"> 募集计划：</span></th>
 	<td >
 		<select id="raisePlan" ></select>
 	</td>
  
</tr>

<tr>
   <th> 账单日(始)：</th>
   <td>
   	<input type="text" class="text" onkeyup="chkInt(this)" id="statementDateStart" name="statementDateStart"  value="${dealDto.billDate}">
  </td>
  <th> 账单日(止)：</th>
   <td>
   	<input type="text" class="text" onkeyup="chkInt(this)" id="statementDateEnd" name="statementDateEnd"  value="${dealDto.billDateEnd}">
  </td>
  <th> 还款方式：</th>
  <td> 
<syscode:dictionary name="publicRepayType"  codeType="CM_REPAYMENTWAY" id="publicRepayType"	
      className="text" type="select"/>
     </td> 
</tr>

<%-- <tr id="statementTr" style="display:none;">
   <th> 账单日：</th>
   <td colspan="6">
  	  <syscode:dictionary defaultValue=""  name="statementDate" codeType="TATEMENT_DATE" id="statementDate" className="text" type="select"/>
  </td>
</tr> --%>
</table>

<!-- 列表按钮操作 start -->
	<div id="creditDetailOperation" class="tableToolbar">
		  	<a id="addDataLoan" href="javascript:void(0)" onclick="toAddDataLoan()" title="将贷款额度申请信息下未使用的贷款明细新增到该交易下">新增</a>
		  	<%--<a href="javascript:void(0)" onclick="deleteLoan()" >删除</a>
		  	--%><a href="javascript:void(0)" onclick="sureExport()" title="导出贷款明细">导出</a>
		  	<!-- <a href="javascript:void(0)" id="downLoadFile" onclick="downLoadLoan()" >下载</a> -->
		  	<a href="javascript:void(0)" id="importLoanFile" onclick="importCreditDetail('true','CONFIRM')" 
		  	    title="基于导出的EXCEL贷款明细，审核贷款明细(审批通过或审批拒绝)">导入</a>

	</div>

	<div id="creditDetailTable">
		<%@include file="../loanDealManage/viewLoanDetail.jsp" %>
	</div>
 
<!-- <table class="formTableSwap" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
 	<td colspan="6" align="center" class="thTop">债权结算</td>	
</tr>

<tr>
  <th style="width:100px;"> 费用金额：</th>
  <td colspan="6" align="left"> 
  <input type="text" class="text" id="dtopracticalSellSum" name="practicalSellSum"  maxLength="11" value="" />
  </td>
 
</tr>
</table> -->

</form>
<div class="expandToolbar">
		<span id="saveBtn" class="submitBtn mouseName" onclick="saveLoanDeal()" title="确认本次新增贷款信息">确认</span>
		<span id="finishBtn" class="submitBtn mouseName" onclick="doFinish()" title="设置该批次交易完成(不可新增贷款明细)，并通知理财机构(铜板街、向上、向前)完成">完成</span>
		<span id="sendBtn" class="submitBtn mouseName" onclick="doSend()" title="给铜板街发送借款人的放款信息">推送</span>
		
		<span class="submitBtn mouseName" onclick="closeFather()" title="关闭当前打开页面">关闭</span>
</div>
<div>
	<br  /><font color="red">导入excel信息必须为导出数据的模板，每次导入数据建议为一千条数据。</font>
	<br  /><font color="red">导入excel信息贷款状态填写内容为：“审批通过”，“审批拒绝”。</font>
	<br  /><font color="red">先“完成”才能进行“推送”。</font>
	
</div>
</div>

</body>

<script type="text/javascript">
   $(document).ready(function(){
   	checkedInit();
   	$("#creditorAffirmRule").prop("disabled",true);
	});
	
	
	
</script>
  
</html>
